package edu.cwnu.enterprisemanagement.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
public class BusinessException extends RuntimeException {
    private Integer code; // 错误状态码
    private String message; // 错误信息

    public BusinessException(String message) {
        super(message);
        this.message = message;
        this.code = 0; // 默认错误码
    }

    public BusinessException(Integer code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }
}